package com.heima.seckill.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.heima.seckill.pojo.Order;
import com.heima.seckill.pojo.User;
import com.heima.seckill.vo.GoodsVo;
import com.heima.seckill.vo.OrderDetailVo;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 订单表 服务类
 * </p>
 *
 * @author zhujia
 * @since 2022-04-20
 */
public interface IOrderService extends IService<Order> {

    Order seckill(User user, GoodsVo goods);

    OrderDetailVo detail(Long orderId);

    /**
     * 获取秒杀地址
     * @param user
     * @param goodsId
     * @return
     */
    String createPath(User user, Long goodsId);

    /**
     * 判断秒杀地址是否正确
     * @param user
     * @param goodsId
     * @return
     */
    boolean checkPath(User user, String goodsId,String path);

    /**
     * 校验验证码
     * @param user
     * @param goodsId
     * @param captcha
     * @return
     */
    boolean checkCaptcha(User user, Long goodsId, String captcha);
}
